@use "config";

@function joinVarNames($list) {
  $name: "--" + config.$namespace;

  @each $item in $list {
    @if $item != "" {
      $name: $name + "-" + $item;
    }
  }

  @return $name;
}

@function getCssVarCalc($calc, $args...) {
  @return calc(var(#{joinVarNames($args)}) + $calc);
}
